package team.you.ticket.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import team.you.ticket.pojo.Result;
import team.you.ticket.service.TicketService;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/ticketInfo")
public class TicketCtrl {
    @Autowired
    private TicketService ticketService;

    @RequestMapping("/get")
    @ResponseBody
    private Result get(Integer page, HttpServletRequest request)
    {
        return ticketService.get(page,request);
    }
    @ResponseBody
    @RequestMapping("/getPages")
    private Result getPages()
    {
        return ticketService.getPages();
    }
    @RequestMapping("/del")
    @ResponseBody
    private Result del(String ticketId)
    {
        return ticketService.del(ticketId);
    }
}
